import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';

import '../../base/imageres.dart';
import '../../base/constant.dart';
import '../../base/stringres.dart';
import '../../base/theme.dart';
import '../../views/jsw_base_view.dart';

///女性健康下面的说明选择
class ExplainSelectPage extends StatefulWidget {
  const ExplainSelectPage({super.key});

  @override
  State<StatefulWidget> createState() {
    return _ExplainSelectPageState();
  }
}

class _ExplainSelectPageState extends State<ExplainSelectPage> {
  static const _tag = '[page_explain_select.dart][_ExplainSelectPageState]';

  @override
  void initState() {
    super.initState();
    SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
        overlays: SystemUiOverlay.values);
  }

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        Container(
          decoration: const BoxDecoration(
            image: DecorationImage(
              image: AssetImage(ImageRes.bg_health_set),
              fit: BoxFit.cover, // 图片填充方式
            ),
          ),
        ),
        Scaffold(
          backgroundColor: Colors.transparent, // 设置 Scaffold 背景透明
          appBar: AppBar(
            elevation: 0.0,
            backgroundColor: Colors.transparent,
            title: EasyTouch(
              width: double.infinity,
              padding: const EdgeInsets.only(right: 55),
              child: Text(
                StringRes.explain,
                textAlign: TextAlign.center,
                style: ThemeUtil.toolbar,
              ),
            ),
            leading: IconButton(
              splashColor: Colors.transparent,
              highlightColor: Colors.transparent,
              hoverColor: Colors.transparent,
              icon: const Icon(
                Icons.arrow_back,
                color: Colors.white,
              ),
              onPressed: () {
                Get.back();
              },
            ),
          ),
          body: Column(
            children: [
              //环形说明
              EasyTouch(
                width: double.infinity,
                onPressed: () async {
                  Get.toNamed(PageIndex.circularExplainPage);
                },
                child: Container(
                    width: double.infinity,
                    margin: const EdgeInsets.only(top: 42, left: 15, right: 15),
                    padding: const EdgeInsets.only(
                        top: 17, bottom: 17, left: 15, right: 15),
                    decoration: BoxDecoration(
                      color: Colors.white12,
                      borderRadius: BorderRadius.circular(20.0), // 设置圆角半径
                    ),
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.start,
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: [
                        Text(
                          textAlign: TextAlign.left,
                          StringRes.circular_explain,
                          style: ThemeUtil.mp2,
                        ),
                        const Spacer(),
                        Image(
                          image: AssetImage(ImageRes.ic_arrow_right),
                          width: 8,
                          height: 16,
                          fit: BoxFit.cover,
                        ),
                      ],
                    )),
              ),

              //图表说明
              EasyTouch(
                width: double.infinity,
                onPressed: () async {
                  Get.toNamed(PageIndex.chartExplainPage);
                },
                child: Container(
                    width: double.infinity,
                    margin: const EdgeInsets.only(top: 10, left: 15, right: 15),
                    padding: const EdgeInsets.only(
                        top: 17, bottom: 17, left: 15, right: 15),
                    decoration: BoxDecoration(
                      color: Colors.white12,
                      borderRadius: BorderRadius.circular(20.0), // 设置圆角半径
                    ),
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.start,
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: [
                        Text(
                          textAlign: TextAlign.left,
                          StringRes.chart_explain,
                          style: ThemeUtil.mp2,
                        ),
                        const Spacer(),
                        Image(
                          image: AssetImage(ImageRes.ic_arrow_right),
                          width: 8,
                          height: 16,
                          fit: BoxFit.cover,
                        ),
                      ],
                    )),
              ),
            ],
          ),
        ),
      ],
    );
  }
}
